
#include <linux/module.h>  
#include <linux/kernel.h>  
#include <linux/fs.h>  
#include <linux/firmware.h>  
  
static struct firmware *fw_handle;  
static char buff[256];

ftest_config_cb(const struct firmware *cfg, void *ctx)
{
    printk(KERN_INFO"hello: size=%d, content=%s\n", cfg->size, buff);
}

static int __init my_module_init(void) {  
    int ret;  
//    ret = request_firmware_nowait(THIS_MODULE, 1, "my_firmware", NULL, GFP_KERNEL, NULL, ftest_config_cb);  

    ret = request_firmware(&fw_handle, "my_firmware", NULL);
    if (ret) {  
        printk(KERN_ERR "Failed to request firmware\n");  
        return ret;  
    }  
    printk(KERN_INFO "Successfully requested firmware\n");  
    return 0;  
}  
  
static void __exit my_module_exit(void) {  
    release_firmware(fw_handle);  
    printk(KERN_INFO "Released firmware\n");  
}  
  
module_init(my_module_init);  
module_exit(my_module_exit);  
MODULE_LICENSE("GPL");
MODULE_FIRMWARE("my_firmware");
